package com.wyw.hemerocallis.controller;

import com.wyw.hemerocallis.stream.DefaultReceiveService;
import com.wyw.hemerocallis.stream.DefaultSendService;
import com.wyw.hemerocallis.stream.wyw.WywReceiveService;
import com.wyw.hemerocallis.stream.wyw.WywSendService;
import com.wyw.hemerocallis.vo.WywMessage;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 构建消息驱动
 *
 * @author Mr Wu    yewen.wu.china@gmail.com
 * <p>
 * Update History:
 * Author        Time            Content
 */
@Slf4j
@RestController
@RequestMapping("/message")
public class MessageController {
    private final DefaultSendService defaultSendService;
    private final WywSendService wywSendService;

    public MessageController(DefaultSendService defaultSendService, WywSendService wywSendService) {
        this.defaultSendService = defaultSendService;
        this.wywSendService = wywSendService;
    }

    /**
     * 默认信道
     */
    @GetMapping("default")
    public void defaultSend() {
        defaultSendService.sendMessage(WywMessage.defaultMessage());
    }

    /**
     * 自定义信道
     */
    @GetMapping("wyw")
    public void wywSend() {
        wywSendService.sendMessage(WywMessage.defaultMessage());
    }


}
